﻿using Sunboxsoft.Bases.Web.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace Sunboxsoft.Bases.Web.ApiControllers
{
    public class UserController : ApiController
    {
        [HttpGet]
        public ApiResult List(string filter = null, int start = 0, int limit = 25, string sortName = null, string sortDirection = null)
        {
            List<User> items = new List<User>();
            for (int index = start; index < start + limit; index++)
            {
                items.Add(new User()
                {
                    Name = filter + "-name-" + index.ToString(),
                    Account = filter + "-account-" + index.ToString(),
                    IsEnabled = true
                });
            }
            return new ApiResult(new PagedList<User>(start, limit, 50, items));
        }
    }
}
